package com.hqyj.common.dao;

import com.hqyj.common.pojo.BaseTopic;
import com.hqyj.common.pojo.ShortTopic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

/**
 * <p>
 * 简答题库 Mapper 接口
 * </p>
 *
 * @author j0701-9
 * @since 2021-10-20
 */
public interface ShortTopicMapper extends BaseMapper<ShortTopic> {

    /**
     * 随机查询 quantity 条简答题
     * @param quantity
     * @return
     */
    @Select("SELECT * FROM `short_topic` order by rand() limit #{quantity}")
    ArrayList<ShortTopic> randomSelectBrief(int quantity);

}
